package com.zwt.controller;

import com.zwt.bean.SysResource;
import com.zwt.reflect.jdk.JdkProxyExamlpe;
import com.zwt.service.SysResourceService;
import com.zwt.service.TestService;
import com.zwt.service.impl.TestServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by zwt on 2018/6/6.
 */
@RequestMapping("test")
@Controller
public class TestController {

    @Autowired
    private SysResourceService sysResourceService;


    @RequestMapping("queryAll")
    @ResponseBody
    public List<SysResource> queryAll(){
        List<SysResource> list = sysResourceService.queryAll();
        return list;
    }

    @RequestMapping("grap")
    public String grap(){
        return "grap";
    }

    public static void main(String[] args) {
        /*TestService testService = new TestServiceImpl();
        testService.say();*/
        JdkProxyExamlpe jdkProxyExamlpe = new JdkProxyExamlpe();
        TestService testService = (TestService)jdkProxyExamlpe.bind(new TestServiceImpl());
        testService.say();
    }
}
